<!DOCTYPE html>
<html >
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
  <script src="../../js/vue.js"></script>  <!-- vue追加 -->
  <script src="../../js/axios.min.js"></script>		<!-- vue的AJAX追加 -->
 
  <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
 	
<style type="text/css">
	#empinfo{
		margin-top: 30px;
		margin-left: 80px;
		
	}
	
</style>
</head>
<body>
<br/>
<!-- 更改信息页 -->
<div style="margin-top:40px ;margin-left: 120px" >
	<font size="5">新增科室信息页</font></div><br/>
	
<div id="officeInfo" style="">
	
	<div class="layui-col-md7" style="margin-top: 10px">
		<input  v-model="officeId"  type="text" name="title" placeholder="请输入科室编号" autocomplete="off" class="layui-input">
	</div>
	<div class="layui-col-md7" style="margin-top: 10px">
		<input  v-model="officeName"  type="text" name="title" placeholder="请输入科室名称" autocomplete="off" class="layui-input">
	</div>
	
	<div class="layui-col-md7" style="margin-top: 10px">
		<input type="button"  @click="addOffice" value="提交新增科室信息" style="margin-left: 100px" class="layui-btn layui-btn-radius"/><br/>
	</div>
</div>

<script >
	var officeInfo=new Vue({
		el:"#officeInfo",
		
		data:{
			officeId:"",
			officeName:"",
		},
		
		methods:{
			addOffice:function(){
				axios.get(
					"http://localhost:8080/addOffice",{
						params:{
							officeId:this.officeId,
							officeName:this.officeName
						}
					}
				).then(data=>{
					
					alert(data.data.msg);
				})
			}
			
		}
		
		
	})
</script>

</body>
</html>